DROP TABLE IF EXISTS jms_dim.dim_lmdm_sys_special_time_limit_base;
CREATE EXTERNAL TABLE `jms_dim.dim_lmdm_sys_special_time_limit_base`(
  `id` bigint COMMENT '主键id',
  `combine_key` string COMMENT '组合key md5(网点id+加时类型id+班次+国家+省+市+区+乡镇)',
  `network_id` bigint COMMENT '网点id',
  `network_code` string COMMENT '网点编码',
  `extra_time_type` smallint COMMENT '加时类型:1收件加时,2派件加时',
  `extra_time` string COMMENT '加时时效',
  `shift` smallint COMMENT '班次',
  `country_id` bigint COMMENT '国家id',
  `provider_id` bigint COMMENT '省份id',
  `city_id` bigint COMMENT '城市id',
  `area_id` bigint COMMENT '区/县id',
  `township_id` bigint COMMENT '乡镇id',
  `special_address` string COMMENT '特殊地址',
  `is_enable` smallint COMMENT '是否启用:1启用,2不启用',
  `is_delete` smallint COMMENT '是否删除:1未删除,2已删除',
  `create_by` bigint COMMENT '创建人id',
  `update_by` bigint COMMENT '最后更新人id',
  `create_by_name` string COMMENT '创建人名称',
  `update_by_name` string COMMENT '最后修改人名称',
  `create_time` timestamp COMMENT '创建时间',
  `update_time` timestamp COMMENT '更新时间',
  `distance_to_town` double COMMENT '到乡镇距离',
  `audit_status` smallint COMMENT '审核状态  0待审核 1已审核 2已驳回',
  `effective_time` timestamp COMMENT '生效时间',
  `effective_status` smallint COMMENT '生效状态 0待生效  1生效中  2失效中',
  `expire_time` timestamp COMMENT '失效时间',
  `audit_by` bigint COMMENT '审核人id',
  `audit_by_name` string COMMENT '审核人',
  `audit_refuse_reason` string COMMENT '驳回原因',
  `batch_no` string COMMENT '批次号',
  `batch_no_serial` bigint COMMENT '批次号-序列号',
  `parent_id` bigint COMMENT '父id')
COMMENT '特殊时效维护表'
STORED AS PARQUET
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dim.db/external/dim_lmdm_sys_special_time_limit_base'
TBLPROPERTIES (
  'parquet.column.index.access'='true'
);